package com.hzf.designer.dao.model;

import java.io.Serializable;

public class DneedsDesigner implements Comparable,Serializable {
    /**
     * 主键
     *
     * @mbg.generated
     */
    private Integer id;

    /**
     * 关联用户ID
     *
     * @mbg.generated
     */
    private Integer userId;

    /**
     * 从业时间多长
     *
     * @mbg.generated
     */
    private Integer industryYear;

    /**
     * 用户接单状态：0：空闲，1：工作
     *
     * @mbg.generated
     */
    private Integer orderState;

    /**
     * 自我介绍
     *
     * @mbg.generated
     */
    private String userContent;

    /**
     * 经度
     *
     * @mbg.generated
     */
    private Double lng;

    /**
     * 维度
     *
     * @mbg.generated
     */
    private Double lat;

    private Long geoCode;

    /**
     * 订单总计
     *
     * @mbg.generated
     */
    private Integer sales;

    /**
     * 用户状态
     *
     * @mbg.generated
     */
    private Integer state;

    private Integer city;

    /**
     * 图片
     *
     * @mbg.generated
     */
    private String imgUrl;

    private double distanceKm;

    private String userName;

    private long phone;

    private int anliCount;
    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getIndustryYear() {
        return industryYear;
    }

    public void setIndustryYear(Integer industryYear) {
        this.industryYear = industryYear;
    }

    public Integer getOrderState() {
        return orderState;
    }

    public void setOrderState(Integer orderState) {
        this.orderState = orderState;
    }

    public String getUserContent() {
        return userContent;
    }

    public void setUserContent(String userContent) {
        this.userContent = userContent;
    }

    public Double getLng() {
        return lng;
    }

    public void setLng(Double lng) {
        this.lng = lng;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Long getGeoCode() {
        return geoCode;
    }

    public void setGeoCode(Long geoCode) {
        this.geoCode = geoCode;
    }

    public Integer getSales() {
        return sales;
    }

    public void setSales(Integer sales) {
        this.sales = sales;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getCity() {
        return city;
    }

    public void setCity(Integer city) {
        this.city = city;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public double getDistanceKm() {
        return distanceKm;
    }

    public void setDistanceKm(double distanceKm) {
        this.distanceKm = distanceKm;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getAnliCount() {
        return anliCount;
    }

    public void setAnliCount(int anliCount) {
        this.anliCount = anliCount;
    }

    public long getPhone() {
        return phone;
    }

    public void setPhone(long phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", industryYear=").append(industryYear);
        sb.append(", orderState=").append(orderState);
        sb.append(", userContent=").append(userContent);
        sb.append(", lng=").append(lng);
        sb.append(", lat=").append(lat);
        sb.append(", geoCode=").append(geoCode);
        sb.append(", sales=").append(sales);
        sb.append(", state=").append(state);
        sb.append(", city=").append(city);
        sb.append(", imgUrl=").append(imgUrl);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DneedsDesigner other = (DneedsDesigner) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getIndustryYear() == null ? other.getIndustryYear() == null : this.getIndustryYear().equals(other.getIndustryYear()))
            && (this.getOrderState() == null ? other.getOrderState() == null : this.getOrderState().equals(other.getOrderState()))
            && (this.getUserContent() == null ? other.getUserContent() == null : this.getUserContent().equals(other.getUserContent()))
            && (this.getLng() == null ? other.getLng() == null : this.getLng().equals(other.getLng()))
            && (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat()))
            && (this.getGeoCode() == null ? other.getGeoCode() == null : this.getGeoCode().equals(other.getGeoCode()))
            && (this.getSales() == null ? other.getSales() == null : this.getSales().equals(other.getSales()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getCity() == null ? other.getCity() == null : this.getCity().equals(other.getCity()))
            && (this.getImgUrl() == null ? other.getImgUrl() == null : this.getImgUrl().equals(other.getImgUrl()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getIndustryYear() == null) ? 0 : getIndustryYear().hashCode());
        result = prime * result + ((getOrderState() == null) ? 0 : getOrderState().hashCode());
        result = prime * result + ((getUserContent() == null) ? 0 : getUserContent().hashCode());
        result = prime * result + ((getLng() == null) ? 0 : getLng().hashCode());
        result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode());
        result = prime * result + ((getGeoCode() == null) ? 0 : getGeoCode().hashCode());
        result = prime * result + ((getSales() == null) ? 0 : getSales().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
        result = prime * result + ((getImgUrl() == null) ? 0 : getImgUrl().hashCode());
        return result;
    }
    @Override
    public int compareTo(Object o) {
        DneedsDesigner p = (DneedsDesigner) o;
        if(p.distanceKm<this.distanceKm){
            return 1;
        }
        else if(p.distanceKm>this.distanceKm){
            return -1;
        }
        else{
            return 0;
        }

    }
}